package com.mi9688.stream;

import com.mi9688.lambda.Student;

import java.util.Arrays;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;




public class ListToSet {
	public static void main(String [] args){

		List<Student> students=Arrays.asList(new Student("小明",18),new Student("小黑",16),new Student("小红",17));
		Set<Student> sets=students.stream().collect(Collectors.toSet());
		sets.forEach(stu->System.out.println(stu.toString()));
		
	}
	
}
